pkgs_i_want <- c(
    "pacman", ## package manager
    "BiocManager", ## manage Bioconductor packages
    "moments", ## support skewness(), kurtosis()
    ## "skimr", ## skim a data frame, conflict tidyverse::filter
    ## "tidyverse", ## provide "stringr", "dplyr", "tidyr", "ggplot2",
    ## "RColorBrewer", ## creates nice looking color palettes
    "magrittr", ## provide pipe %>%
    ## "lubridate", ## dealing with Date data
    ## recommended by /R4DataScience/ starting with tidyverse
    "haven", ## r/w: SPSS.sav, SAS.sas, Stata.dta etc.
    ## "foreign", ## lookup/read.xport to view .xpt
    "readxl", ## reads Excel files (both .xls and .xlsx)
    "sqldf", ## run SQL within R and return a data.frame
    ## "DBI", ## run SQL queries against a database and return a data.frame
    "rio", ## import/outport
    "languageserver", ## Language Server Protocol
    ## export documents
    "knitr", "lintr", "rmarkdown", "highr", "styler",
    "devtools", ## track (& contrib to) dev easier
    "data.table" ## may conflict dplyr::functions() etc.
)

ipak <- function(pkg){
    new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
    if (length(new.pkg))
        install.packages(new.pkg, dependencies = TRUE)
    ## sapply(pkg, require, character.only = TRUE)
}

ipak(pkgs_i_want)
